clear, close, clc

w = 2*pi;
d = .25;
A = [0 1; -w^2 -2*d*2];
dt = 0.01;
T = 10;
x0 = [2;0];

[t,x] = ode45(@(t,x) A*x, 0:dt:T, x0);

plot(t,x(:,1)) % 从1开始 第一列是x，第二列是v